package vcp.models;


import vcp.common.AbstractModel;
import client.Message;
import control.SimpleClient;
import db.parking.beans.Orders;
import db.parking.beans.Subscriber;

/**
 * Customer Check in model
 * @author G15
 * 
 *
 */
public class CheckInModel  extends AbstractModel {
    
	

	
	/**
	 * Regular customer check in
	 * Sends request to server
	 * @param bean
	 */
	public void checkinRegular(Orders bean) {
		client = SimpleClient.getInstance();
		client.addPropertyChangeListener(this);		
		Message msg = new Message(bean,"CheckInRegular");
		 try {
				client.sendToServer(msg);				
		 }
		 catch (Exception ex)
		    {
			 System.out.println(ex.toString()+"Insert->CheckInRegular");
		    }	
	}

	/**
	 * Subscribed customer checkin
	 * Sends request to server
	 * @param bean
	 */
	public void checkinSubscribed(Subscriber bean) {
		client = SimpleClient.getInstance();
		client.addPropertyChangeListener(this);	
		
		Message msg = new Message(bean,"CheckInSubscriber");
		 try {
				client.sendToServer(msg);				
		 }
		 catch (Exception ex)
		    {
			 System.out.println(ex.toString()+"Insert->CheckInSubscriber");
		    }		
	} 
}
